﻿<%@ page language="java" pageEncoding="UTF-8" %>
<%@ include file="/common/head.jsp"%>
<%@ include file="/common/left.jsp"%>
<%@ include file="/common/righthead.jsp"%>

<script>menuSelected = "FUN001";</script>

<div class="content">
	<div id="yui-main">
	<div class="yui-b">
	
	<form id="mainForm" action="user.action" method="post">
		<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
		<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
		<input type="hidden" name="page.order" id="order" value="${page.order}"/>

		<div id="message"><s:actionmessage theme="custom" cssClass="success"/></div>
		<div id="filter">
			你好, <s:property value="@org.springside.modules.security.springsecurity.SpringSecurityUtils@getCurrentUserName()"/>.&nbsp;&nbsp;
			登录名: <input type="text" name="filter_EQS_loginName" value="${param['filter_EQS_loginName']}" size="9"/>
			姓名或Email: <input type="text" name="filter_LIKES_name_OR_email"
							 value="${param['filter_LIKES_name_OR_email']}" size="9"/>
							 
			<div class="button">
				<div class="left">
					<div class="right">				 
						<input  class="inputButton" type="button" value="搜索" onclick="search();"/>
					</div>
				</div>
			</div>
		</div>
		<div id="content">
			<table id="contentTable">
				<tr>
					<th><a href="javascript:sort('loginName','asc')">登录名</a></th>
					<th><a href="javascript:sort('name','asc')">姓名</a></th>
					<th><a href="javascript:sort('email','asc')">电邮</a></th>
					<th>角色</th>
					<th>操作</th>
					<th>view publish info</th>
				</tr>

				<s:iterator value="page.result">
					<tr>
						<td>${loginName}&nbsp;</td>
						<td>${name}&nbsp;</td>
						<td>${email}&nbsp;</td>
						<td>${roleNames}&nbsp;</td>
						<td>&nbsp;
							<security:authorize ifAnyGranted="ROLE_浏览用户">
								<security:authorize ifNotGranted="ROLE_修改用户">
									<a href="user!input.action?id=${id}">查看</a>&nbsp;
								</security:authorize>
							</security:authorize>

							<security:authorize ifAnyGranted="ROLE_修改用户">
								<a href="user!input.action?id=${id}">修改</a>&nbsp;
								<a href="user!delete.action?id=${id}">删除</a>
							</security:authorize>
						</td>
						<td><a href="../publish/publish-info.action">click to view</></td>
					</tr>
				</s:iterator>
			</table>
		</div>

		<div>
			第${page.pageNo}页, 共${page.totalPages}页
			<a href="javascript:jumpPage(1)">首页</a>
			<s:if test="page.hasPre"><a href="javascript:jumpPage(${page.prePage})">上一页</a></s:if>
			<s:if test="page.hasNext"><a href="javascript:jumpPage(${page.nextPage})">下一页</a></s:if>
			<a href="javascript:jumpPage(${page.totalPages})">末页</a>

			<security:authorize ifAnyGranted="ROLE_修改用户">
				<a href="user!input.action">增加新用户</a>
			</security:authorize>
		</div>
	</form>
	</div>
	</div>
</div>

<%@ include file="/common/foot.jsp" %>